package com.spms.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.spms.entity.Practice;
import com.spms.entity.Student;
import com.spms.service.Impl.StudentServiceImpl;

@RestController
@ResponseBody
public class StudentController {	
	@Autowired
	private StudentServiceImpl studentservice;
	
	@RequestMapping("/student/findallpractice")
	public List<Practice> FindAllPractice(String address, String teacher_name){
		return studentservice.FindAllPractice(address,teacher_name);
	}
	@RequestMapping("/student/login")
	public Student Login(String user_name, String user_password) {
		return studentservice.Login(user_name, user_password);
	}
	@RequestMapping("/student/register")
	public int Register(Student student) {
		return studentservice.Register(student);
	}
	@RequestMapping("/student/insertpractice")
	public int InsertPractice(int s_id, int p_id,int t_id) {
		return studentservice.InsertPractice(s_id, p_id,t_id);
	}
	@RequestMapping("/student/deletepractice")
	public int DeletePractice(int pd_id) {
		return studentservice.DeletePractice(pd_id);
	}
	@RequestMapping("/student/findmypractice")
	public List<Practice> FindMyPractice(int s_id){
		return studentservice.FindMyPractice(s_id);
	}
	@RequestMapping("/student/insertthink")
	public int InsertThink(int s_id,int p_id,String think){
		return studentservice.InsertThink(s_id,p_id,think);
	}
	@RequestMapping("/student/queryInfo")
	public Student queryInfo(int s_id){
		return studentservice.queryInfo(s_id);
	}
	
	
	
}
